/*@getBrowser
 * IE: MSIE 6~8
 * FF: Firefox/~
 * Maxthon: Maxthon/~
 * Chrome: Chrome/~
 * Safari: Safari/~
 * Rendering Engine: Trident,Gecko,Webkit,Presto,Kestrel
 */
var getBrowser = {
	version:function(str){
		return navigator.userAgent.indexOf(str);
	},
	versionStr:function(){
		return navigator.userAgent;
	},
	versionCode:function(key,separa){
		if(this.version(key)>0){
			var str = this.versionStr().slice(this.version(key));
			var strArr = str.split(separa);
			return strArr[0];
		}else{
			return false;
		}
	},
	ie:function(){//IE
		return this.versionCode('MSIE',';');
	},
	ff:function(){
		return this.versionCode('Firefox/','.');
	},
	Maxthon:function(){
		return this.versionCode('Maxthon/','.');
	},
	Chrome:function(){
		return this.versionCode('Chrome/','.');
	},
	Safari:function(){
		if(this.version('Safari/')>0 && this.version('Version/')>0){
			return this.versionCode('Version/','.');			
		}else{
			return false;
		}
	},
	Trident:function(){//Trident
		return this.versionCode('Trident/',';');
	},
	Gecko:function(){//Gecko
		return this.versionCode('Gecko/',' ');
	},	
	Webkit:function(){//Webkit
		return this.versionCode('WebKit/',' ');
	},
	Presto:function(){
	},
	Kestrel:function(){
	}
}
//document.write(navigator.userAgent);
if(getBrowser.ie()){
	alert(getBrowser.ie());
}
if(getBrowser.ff()){
	alert(getBrowser.ff());
}
if(getBrowser.Maxthon()){
	alert(getBrowser.Maxthon());
}
if(getBrowser.Chrome()){
	alert(getBrowser.Chrome());
}
if(getBrowser.Safari()){
	alert(getBrowser.Safari());
}
if(getBrowser.Trident()){
	alert(getBrowser.Trident());
}
if(getBrowser.Gecko()){
	alert(getBrowser.Gecko());
}
if(getBrowser.Webkit()){
	alert(getBrowser.Webkit());
}

/*
alert(navigator.appVersion.replace(/\s+/g,""));
alert(navigator.appName); 
alert(navigator.userAgent);
alert(navigator.language);
*/